//
//  HYDeviceAddVC.m
//  TJHYHardwareProduct
//
//  Created by yc on 2017/12/25.
//  Copyright © 2017年 Cong Yao. All rights reserved.
//

#import "HYDeviceAddVC.h"
#import "ScanDeviceViewController.h"

@interface HYDeviceAddVC ()
@property(nonatomic,strong)UIImageView *bgImageView;
@property(nonatomic,strong)UIButton *addButton;

@end

@implementation HYDeviceAddVC

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

#pragma mark - 点击事件
- (void)didClickAddDeviceButton
{
    ScanDeviceViewController *vc = [ScanDeviceViewController new];
    vc.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:vc animated:YES];
}

#pragma mark - 懒加载
- (UIImageView *)bgImageView
{
    if(!_bgImageView)
    {
        UIView *superView = self.view;
        _bgImageView = [[UIImageView alloc]init];
        [superView addSubview:_bgImageView];
        _bgImageView.image = [UIImage imageNamed:@"but_switch_on"];
    }
    return _bgImageView;
}
- (UIButton *)addButton
{
    if(!_addButton)
    {
        UIView *superView = self.view;
        _addButton = [[UIButton alloc]init];
        [superView addSubview:_addButton];
        [_addButton setImage:imageWithName(@"but_add") forState:UIControlStateNormal];
        [_addButton addTarget:self action:@selector(didClickAddDeviceButton) forControlEvents:UIControlEventTouchUpInside];
    }
    return _addButton;
}
#pragma mark - 初始化布局
- (void)base_masLayoutSubview
{
    __weak UIView *superView = self.view;
    [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(superView);
    }];
    
    [self.addButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(_bgImageView);
    }];
}

#pragma mark - 导航栏设置
- (void)base_configNavigationBar
{
    [self setNavigationTitle:@"设备添加" titleColor:[UIColor blackColor]];
}

- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleDefault;
}







#pragma mark -
#pragma mark - Public Method


#pragma mark -
#pragma mark - Actions Method


#pragma mark -
#pragma mark - Notification


#pragma mark -
#pragma mark - DelegateName


#pragma mark -
#pragma mark - Setter Method


#pragma mark -
#pragma mark - Data_Handlers


#pragma mark -
#pragma mark - SubViews Manager

- (void)cy_configSubView {
    [self setNavigationBarTitle:@"设备添加"];
}

#pragma mark -
#pragma mark - Constraint


#pragma mark -
#pragma mark - Lazy Load


@end
